<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="java.util.ArrayList,edu.student.models.*, com.opensymphony.xwork2.ActionContext" %>

<html>
<script language="JavaScript" type="text/javascript">
function doValidation() {
	var name=document.getElementById("name").value;
	var is_current=document.getElementById("is_current").value; 
	if (name==""){
		alert("Name field is manadtaory.Please enter appropriately");
		return false;
	}
	if (is_current==""){
		alert("Is Current? field is manadtaory.Please enter appropriately");
		return false;
	}
	return true;
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Modify lookup value</title>
<link rel="stylesheet" href="mystyle.css">
</head>

<body>
<h1 align="left">Add Value in Lookup <%=ActionContext.getContext().getSession().get("table") %></h1> 
<%String table = (String)ActionContext.getContext().getSession().get("table"); %>
<s:form action="add_lookup" align="left">
<s:hidden name="table" value="%{lookup.table}" id="table"/>
<s:hidden name="lookup_id" value="%{lookup.id}"/>
<table id="text" align="center">
<tr>
<td><s:textfield  label="Name" name="name" id="name" value="%{lookup.name}"/></h2> </td>
</tr>
<tr>
 <td><s:select label="Is current?" headerKey="" headerValue="-none-" name="is_current" list="#{'y':'yes', 'n':'no'}" value="" id="is_current" />
</tr>
<td>
<s:submit name ="submit" value="Add" id="mysubmit" align="center" onClick="return doValidation()" />
</td>
<td>
</td>
</table>
</s:form>

</body>
</html>